<%
    def columns = tableDefine.columns
    def varDomainName = tableNameUtil.lowerCaseFirst(tableDefine.id)
    def urlPrefix = "/" + PubUtils.addStrBeforeSeparator(PubUtils.packageToPath(config.category), "/") + varDomainName
%>

<template>
    <div class="manage-page-warpper">
        <search :formItems="searchItems" :model="searchModel" @search="onSearch" ref="search"></search>
        <div class="hr10"></div>
        <btn-oper v-if="btnList" :btns=btnList @handleBtnOper="handleBtnOper" ></btn-oper>

        <base-table     class="table-box"
                        :headers="headers"
                        :datas='dataList'
                        @handleCheckDetail="handleCheckDetail">
        </base-table>
        <pagination :pageNum="pageNum"
                    :pageSize='limit'
                    :total='total'
                    @handleCurrentChange='handleCurrentChange'>
        </pagination>
    </div>
</template>
<script>
import constants from "@/common/utils/constants"

export default {
    data () {

    },
    methods: {
        _initCreatedData () {
            this.searchItems = [
                <%
                    List<String> list=tableModel.getSearchKeyList();
                    def listSize=list.size()

                    list.each{
                        def column=tableDefine.getColumnByColumnName(it);

                        if("Select".equalsIgnoreCase(column.jspTag)) {%>
                            {
                                name: '${column.columnName}',
                                placeholder: '${column.cnname}',
                                type: 'select',
                                options: constants['${column.dictName}']
                            },
                        <%}else {%>
                            {
                                name: '${column.columnName}',
                                placeholder: '${column.cnname}',
                                width: 100
                            },
                        <%}

                    }
                %>
            ]
        },
    }
    created () {
        this._initCreatedData()
    }
}
</script>
